//
//  CheckShopOpenViewController.m
//  SafeFoodManagerDemo
//
//  Created by bob on 2017/11/3.
//  Copyright © 2017年 bob. All rights reserved.
//

#import "CheckShopOpenViewController.h"
#import "CheckRecordViewController.h"
@interface CheckShopOpenViewController ()

@property(nonatomic,strong)CheckRecordViewController *ShopRecordVC;

@property(nonatomic,strong)CheckRecordViewController *OpenRecordVC;

@end

@implementation CheckShopOpenViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self addChildViewController:self.ShopRecordVC];
    
    [self addChildViewController:self.OpenRecordVC];
    
    [self.backScrollView addSubview:self.ShopRecordVC.view];
    
    [self.backScrollView addSubview:self.OpenRecordVC.view];
    
    // Do any additional setup after loading the view.
}

-(CheckRecordViewController*)ShopRecordVC
{
    if (!_ShopRecordVC) {
        
        JobListModel *list=[JobListModel new];
        
        _ShopRecordVC=[CheckRecordViewController new];
        
        list.type=[NSString stringWithFormat:@"%ld",self.type];
        
        list.ptype=@"1";
        
        if ([self getUserType]==2) {
            
            //检查员
            _ShopRecordVC.isdeleMore=YES;
            
            _ShopRecordVC.isEdit=NO;
  
        }else{
            
            //管理员
            
            _ShopRecordVC.isEdit=NO;
            
            _ShopRecordVC.isdeleMore=NO;
   
        }

        _ShopRecordVC.searchName=@"输入关键字";
    
        _ShopRecordVC.isAutoLoding=YES;
        _ShopRecordVC.view.frame=CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-64);
        _ShopRecordVC.title=@"商户检查列表";
        
        _ShopRecordVC.Reqmodel=list;
   
        
    }
    return _ShopRecordVC;
}

-(CheckRecordViewController*)OpenRecordVC
{
    if (!_OpenRecordVC) {
        
        JobListModel *list=[JobListModel new];
        _OpenRecordVC=[CheckRecordViewController new];
        
        list.type=[NSString stringWithFormat:@"%ld",self.type];
        
        list.ptype=@"2";
        
        if ([self getUserType]==2) {
            
            //检查员
            _OpenRecordVC.isdeleMore=YES;
            
            _OpenRecordVC.isEdit=NO;
            
        }else{
            
            //管理员
            
            _OpenRecordVC.isEdit=NO;
            
            _OpenRecordVC.isdeleMore=NO;
            
        }
        
        _OpenRecordVC.searchName=@"输入关键字";

        _OpenRecordVC.view.frame=CGRectMake(SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT-64);
        _OpenRecordVC.title=@"开办方检测列表";
        
        _OpenRecordVC.Reqmodel=list;
        
        _OpenRecordVC.isAutoLoding=NO;
    }
    return _OpenRecordVC;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
